//
//  HGLoopViewCell.swift
//  imageCarouselView
//
//  Created by day-day-Smile on 2018/5/31.
//  Copyright © 2018年 SmileHg. All rights reserved.
//

import UIKit

class HGLoopViewCell: UICollectionViewCell {
    
    var imageView:UIImageView!
    /* collectionView 的 frame 是根据之前的 layout已经确定好的 */
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.imageView = UIImageView(frame: self.bounds)
        self.contentView.addSubview(self.imageView)
    }
    
    var urlModel:URL? {
        didSet{
            if let data = try? Data.init(contentsOf: urlModel!) {
                 self.imageView.image = UIImage.init(data: data)
            }else{
                print("没有数据")
            }
           
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

